package jass.iss.edu.Application;
import java.io.IOException;
import java.util.List;

import jass.iss.edu.Controller.JobAdvertisementController;
import jass.iss.edu.Properties.*;
import jass.iss.edu.Screen.JobAdvertisementListScreen;


public class JASS {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		//JobAdvertisementController controller = new JobAdvertisementController();
		

		//Example: 
		//1. Get AdvertisementList
		 JobAdvertisementDAO DAOAdvert =  new JobAdvertisementDAO();
		 List<JobAdvertisementDTO> lstAdvert = DAOAdvert.getAll();
		 
		//2.Add Advertisement
		 JobAdvertisementDTO advert = new JobAdvertisementDTO("51");
		 advert.setPosition("Programmer");
		 DAOAdvert.add(advert);
		 
		 //3.Get newly added advert and print
		 JobAdvertisementDTO newAdvert = (JobAdvertisementDTO) DAOAdvert.get("51");
		 System.out.println("ID: "+newAdvert.getId()+", Postion: "+newAdvert.getPosition());
		 
		 //4.Modify advert
		 newAdvert.setPosition("Senior Programmer");
		 DAOAdvert.set(newAdvert); //update to properties
		 JobAdvertisementDTO modifiedAdvert = (JobAdvertisementDTO) DAOAdvert.get("51");
		 System.out.println("ID: "+modifiedAdvert.getId()+", Postion: "+modifiedAdvert.getPosition());
		 
		 //5. Delete
		 DAOAdvert.remove("51");
		 
		
		
	}

}
